home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / games / jax.zip / PALET.DOC < prev    next >
Text File  |  1988-02-14  |  8KB  |  249 lines

  1.                                   Documentation
  2.                        for
  3.                         Palet.com, Release 2
  4.  
  5. Overview
  6. --------
  7.  
  8. Palet.com is a TSR (Terminate, but Stay Resident) program that ties into int
  9. 10h and traps (or allows to pass) any changes to the values stored in the EGA
  10. registers. It occupies only 448 bytes of memory (exclusive of memory taken up
  11. by its environment). The program will not reload, but will pass any parameters
  12. to the resident portion when you call it subsequent times.
  13.  
  14.                              Command line instructions 
  15.  
  16. palet
  17. -----
  18.  
  19. Entering this will display a usage screen to refresh your memory, it will not
  20. install the resident portion of palet.
  21.  
  22. palet d       (reset to default)
  23. --------
  24.  
  25. Entering this will install (if not already installed) the TSR portion of palet
  26. and write the default values stored within palet to the EGA registers. This is
  27. a good way to "clean everything up" after playing with setting the EGA regis-
  28. ters with the next command. The 'd' command should precede any other parameters
  29. on the command line.
  30.  
  31. palet o1 o2 .... o16    (set EGA register values)
  32. --------------------
  33.  
  34. Entering this will set any or all of the sixteen EGA palette registers. The
  35. numbers o1, o2, etc. are  two digit octal (sorry) numbers that represent one
  36. of the 64 valid values for the EGA colors. The numbers may be separated by
  37. a space, or you may run all digits together (in which case any single digit
  38. must be preceded by a zero, ie.: 7 4 16 is same as: 070416). It is not nec-
  39. essary to enter values for registers above the ones you wish to change. Values
  40. for registers you wish to remain unchanged can be replaced with a period, ie.:
  41.  
  42.     palet ..7....2    will change registers 3 and 8, and leave others
  43.                   unchanged.
  44.  
  45. This command will change the EGA registers and by default, will set the 'X'
  46. switch, which will allow other programs to change the EGA registers also (see 
  47. the exclude and exclude text commands).
  48.  
  49. palet e    (exclude changes)
  50. -------
  51.  
  52. Entering this will set the exclude changes switch. Palet will now prevent any
  53. attempt to change the values in the EGA registers, no matter what display mode
  54. is set (text or graphics). If you have programs that display in graphics mode,
  55. but don't provide a way to set the colors used, then this is a way to do it.
  56. Some trial and error will usually show you which EGA registers the program is
  57. using so that you can set the registers to suit your preference. Generally, the 
  58. easiest way to use palet for this is in a batch file, ie.:
  59.  
  60.  
  61.                 Page 1
  62.  
  63.  
  64.     echo off
  65.     palet o1 o2 .....o16 e
  66.     program            (program to run) 
  67.         palet d
  68.  
  69. This file will set the registers of the EGA, make the change exclusive and load
  70. the program to run. Upon exiting the program, palet will set the EGA registers
  71. to the default value, leaving the exclude switch set.
  72.  
  73. palet t     (exclude text color changes)
  74. -------
  75.  
  76. This is a variation on the exclude command, as it will only trap text mode
  77. color changes, ie. attempts to change EGA register values while the display is
  78. in graphics mode will go through. 
  79.  
  80. palet x    (turn off exclusions)
  81. -------
  82.  
  83. This command will turn off e or t exclusions, and allow other software to reset
  84. the EGA registers.
  85.  
  86. Command usage
  87. -------------
  88.  
  89. All commands can be combined in any way, with the exception of the 'd' command,
  90. which when used, should precede all other parameters on the command line.
  91.  
  92.     examples:
  93.     --------
  94.  
  95.     palet ...4...16e    will write the octal values 4 and 16 (4 and 14 dec-
  96.                 imal) to the 4th and 8th registers, and set the
  97.                 exclude switch.
  98.  
  99.     palet d..7....2t    will write default values to 16 registers, then 
  100.                 change the 3rd and 8th registers, and set the text
  101.                 exclude switch.
  102.  
  103.     palet dx        will write default values to 16 registers, and turn
  104.                 off the exclude switches.
  105.  
  106. Of course it would be silly to combine 'x' with 't' or 'e' in the same call.
  107. ----------------- 
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.                 Page 2
  125.  
  126.  
  127. Technical
  128. ---------
  129.  
  130. When palet is called, it first checks for DOS 2.0 or higher, and the existence
  131. of the EGA, then 'hooks' itself into int 10h (video interrupt). EGA registers
  132. are reset (if requested in the parameters), and palet's internal switches are
  133. set (if specified in the parameters). Palet then removes most of itself from
  134. memory, leaving behind the TSR portion that monitors all calls to int 10h.
  135.  
  136. A flag is used within palet to monitor the current display mode, this way
  137. palet can determine whether or not to allow changes to the EGA registers to
  138. pass (based on the 'E' and 'T' switch settings).
  139.  
  140. Any display mode function call to the EGA will reset all EGA registers to the
  141. system default values. Palet will allow the display mode change to go through,
  142. then check the 'T' and 'E' switch settings, if the display mode has been 
  143. changed to graphics, and the 'T' switch is set, then palet will allow any EGA
  144. register changes to pass, until the display mode is changed back to text. On 
  145. the other hand, if the 'E' switch is set, then palet will immediately write the
  146. values stored in it's buffer area to the EGA registers, and trap any attempts
  147. to change those values. Any EGA register changes initiated by a call to palet
  148. will be allowed to pass with any switch settings (palet knows when it is called
  149. by itself).
  150.  
  151. A table of palet's default values is contained within the program code (out-
  152. side of the resident portion). By carefully patching palet with debug, you can
  153. customize the default values to your preference. DOS normally uses the 8th EGA
  154. register for its text color (white), and the 1st register for its background 
  155. color; the 3rd EGA register normally contains the value for green. If you pre-
  156. fer green text on black, you can switch the values of the 3rd and 8th EGA reg-
  157. isters (this way you still have white available, albeit in the 3rd EGA regis-
  158. ter). Use debug to patch the locations below:
  159.  
  160. address        value now (hex)    EGA register
  161. ----------------------------------------------
  162. 051eh        0h                    1
  163. 051fh        1h                      2
  164. 0520h         2h             3
  165. 0521h        3h                      4
  166. 0522h        4h                      5
  167. 0523h        5h            6
  168. 0524h           14h            7
  169. 0525h        7h            8
  170. 0526h           38h            9
  171. 0527h           39h               10
  172. 0528h           3ah               11
  173. 0529h           3bh               12
  174. 052ah           3ch               13
  175. 052bh           3dh               14
  176. 052ch           3eh               15
  177. 052dh           3fh               16
  178.                                                                 
  179.  
  180. example:  (next page)
  181.  
  182.  
  183.  
  184.  
  185.                 Page 3
  186.  
  187.  
  188. debug palet.com
  189. -e 051e
  190. xxxx:051E  00.{enter new value here, hex number between 0 and 3F}
  191. -w
  192. -q
  193.  
  194. Do this carefully, and do not change values beyond 052dh.
  195.  
  196. Please note that programs which write directly to the EGA registers (and not
  197. using int 10h) will be able to defeat palet. Programs like this are considered
  198. 'ill-behaved' since they don't use standard DOS or EGA BIOS calls, but address
  199. the hardware directly.
  200.  
  201. Post Script
  202. -----------
  203.  
  204. Palet.com, Release 2 is a public domain program, no claims are made to its 
  205. effectiveness or reliability. The original palette.com has been in use for
  206. some time with no problems, Release 2 should also cause no problems.
  207.  
  208. Palet.com has evolved to it's current level through the joint efforts of 
  209. Charles Lazo III and Tim Worley, whose collaboration began with an exchange
  210. of e-mail on CompuServe. Help support the 'hacker ethic', report any bugs, mod-
  211. ifications, or suggestions for improvements to:
  212.  
  213.     Charles Lazo III            Tim Worley
  214.     P.O. Box 452         or        1314 Poplar St.
  215.     Hohenwald, TN  38462            Charlottesville, VA  22901
  216.  
  217.     CIS ID [72210,17]            CIS ID [71336,730]
  218.  
  219.  
  220. Palet can remain in continuing development if you so desire, but let's make it
  221. a joint effort.
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.                 Page 4
  248.  
  249.